const { program } = require("commander");

program
  .version("0.1.0")
  .argument("<username>", "user to login")
  .argument("[password]", "password for user, if required", 123456)
  .action((username, password) => {
    console.log("username:", username);
    console.log("password:", password);
    // 执行node ./argument.js name, 得到结果 username: name password: 123456
  })
  .parse();
